import requests

key = "39a9c562c0d8388c5bbc4c2b31b1bfdb"  # 替换真实Key
city = "110000"  # 北京编码

# 生活指数请求（添加extensions）
life_url = f"https://restapi.amap.com/v3/weather/life?city={city}&key={key}&extensions=base"
life_res = requests.get(life_url).json()
print("生活指数:", life_res)

# 天气请求（对比）
weather_url = f"https://restapi.amap.com/v3/weather/weatherInfo?city={city}&key={key}"
weather_res = requests.get(weather_url).json()
print("实时天气:", weather_res)